home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / new.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  4.2 KB  |  129 lines

  1. #ifndef __STD_NEW
  2. #define __STD_NEW
  3. #define _INC_NEW  /* MSC guard name */
  4. #define __NEW_H   /* Old Borland guard name */
  5. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  6.  
  7. /***************************************************************************
  8.  *
  9.  * new - declarations for the Standard Library new header
  10.  *
  11.  * $Id: new,v 1.13 1996/08/28 01:29:35 smithey Exp $
  12.  *
  13.  ***************************************************************************
  14.  *
  15.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  16.  * ALL RIGHTS RESERVED *
  17.  * The software and information contained herein are proprietary to, and
  18.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  19.  * intends to preserve as trade secrets such software and information.
  20.  * This software is furnished pursuant to a written license agreement and
  21.  * may be used, copied, transmitted, and stored only in accordance with
  22.  * the terms of such license and with the inclusion of the above copyright
  23.  * notice.  This software and information or any other copies thereof may
  24.  * not be provided or otherwise made available to any other person.
  25.  *
  26.  * Notwithstanding any other lease or license that may pertain to, or
  27.  * accompany the delivery of, this computer software and information, the
  28.  * rights of the Government regarding its use, reproduction and disclosure
  29.  * are as set forth in Section 52.227-19 of the FARS Computer
  30.  * Software-Restricted Rights clause.
  31.  * 
  32.  * Use, duplication, or disclosure by the Government is subject to
  33.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  34.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  35.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  36.  * P.O. Box 2328, Corvallis, Oregon 97339.
  37.  *
  38.  * This computer software and information is distributed with "restricted
  39.  * rights."  Use, duplication or disclosure is subject to restrictions as
  40.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  41.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  42.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  43.  * then the "Alternate III" clause applies.
  44.  *
  45.  **************************************************************************/
  46.  
  47. #include <stdcomp.h>
  48. #include "rw/stddefs.h"
  49. #ifndef _RWSTD_HEADER_REQUIRES_HPP
  50. #include <exception>
  51. #else
  52. #include <exception.hpp>
  53. #endif
  54.  
  55. typedef void (*new_handler) ();
  56.  
  57. #if !defined(_MSC_VER) || defined(__BORLANDC__)
  58. extern new_handler set_new_handler( new_handler new_p );
  59. #endif
  60.  
  61. #ifndef _RWSTD_NO_NAMESPACE 
  62. namespace __rwstd {
  63. #endif
  64.  
  65. extern const char _RWSTDExportFunc(*) __rw_stdexcept_BadAllocException;
  66.  
  67. #ifndef _RWSTD_NO_NAMESPACE 
  68. }
  69. namespace std {
  70. #endif
  71.  
  72. #if !defined(_RWSTD_BAD_ALLOC_DEFINED)
  73. class _RWSTDExport bad_alloc : public exception     
  74.   public:
  75.     bad_alloc () _RWSTD_THROW_SPEC_NULL : exception( )
  76.     { ; }
  77.     bad_alloc(const bad_alloc&) _RWSTD_THROW_SPEC_NULL
  78.     { ; }
  79.     bad_alloc& operator=(const bad_alloc&) _RWSTD_THROW_SPEC_NULL
  80.     { return *this; }
  81.     virtual ~bad_alloc ()  _RWSTD_THROW_SPEC_NULL
  82. #ifdef HPPA_WA
  83. ;
  84. #else
  85. {;}
  86. #endif
  87.  
  88.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  89.     {
  90.         return __RWSTD::__rw_stdexcept_BadAllocException;
  91.     }
  92. };
  93. #endif /*_RWSTD_BAD_ALLOC_DEFINED */
  94.  
  95. struct nothrow {};
  96.  
  97. #ifndef _RWSTD_NO_NAMESPACE 
  98. #endif
  99.  
  100. #ifndef _RWSTD_NO_NEW_BRACKETS
  101. #ifndef _RWSTD_NO_THROW_SPEC_ON_NEW
  102. extern void *operator new(size_t, void*)  _RWSTD_THROW_SPEC_NULL;
  103. inline void* operator new[] ( size_t, void* ptr)  _RWSTD_THROW_SPEC_NULL
  104.  { return ptr; }
  105. #else
  106. extern void *operator new(size_t, void*);
  107. inline void* operator new[] ( size_t, void* ptr)  
  108.  { return ptr; }
  109. #endif // _RWSTD_NO_THROW_SPEC_ON_NEW
  110. #else
  111. #if defined(_MSC_VER) && !defined(__BORLANDC__)
  112. #include <new.h>
  113. extern void *operator new(size_t, void* ptr);
  114. #else
  115. #ifndef _RWSTD_NO_THROW_SPEC_ON_NEW
  116. static inline  void *operator new(size_t, void* ptr) _RWSTD_THROW_SPEC_NULL
  117.  { return ptr; }
  118. #else
  119. static inline  void *operator new(size_t, void* ptr)
  120.  { return ptr; }
  121. #endif // _RWSTD_NO_THROW_SPEC_ON_NEW
  122. #endif // _MSC_VER
  123. #endif // _RWSTD_NO_NEW_BRACKETS
  124.  
  125. #pragma option pop
  126. #endif /*__STD_NEW */
  127.